import Vue from 'vue'
// 引入国际化插件i18
import VueI18n from 'vue-i18n'
// 引入element组件库字典
import elementZh from '../../node_modules/element-ui/lib/locale/lang/zh-CN'
import elementEn from '../../node_modules/element-ui/lib/locale/lang/en'
// 引入菜单字典
import menuZh from './zh'
import menuEn from './en'
// 注册
Vue.use(VueI18n)
// 实例化对象
export default new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
    zh: {
      morning: '早上好！',
      ...elementZh,
      ...menuZh
    },
    en: {
      morning: 'Good morning!',
      ...elementEn,
      ...menuEn
    }
  }
})
